<template>
<!-- （账单详情） -->
<!-- 由于某些数据为null，故先关闭该页面 -->
<div class="w750" :class="myCommisData?'':'white-bg'">
		<!-- 账单详情 -->
		<div class="bill" v-if="myCommisData">
			<div class="item">
				<div class="num">
					<span class="symbol">{{myCommisData.amount>0 ? '+' : ''}}
						<em class="now">{{Money(myCommisData.amount)[0]}}</em>.{{Money(myCommisData.amount)[1]}}
					</span>
				</div>
			</div>
			<div class="item mt10" v-if="myCommisData">
				<div class="line">
					<div class="left">佣金类型：</div>
					<div class="right">{{commisTypeText}}</div>
				</div>
				<div class="line">
					<div class="left">佣金详情：</div>
					<div class="right">{{myCommisData.logDesc}}</div>
				</div>
			</div>
			<div class="item mt10" v-if="myCommisData">
				<div class="line" v-if="myCommisData.addTime">
					<div class="left">交易时间：</div>
					<div class="right">{{myCommisData.addTime | dateformat('YYYY-MM-DD HH:mm:ss')}}</div>
				</div>
				<div class="line">
					<div class="left">流水单号：</div>
					<div class="right">{{myCommisData.sn}}</div>
				</div>
				<div class="line">
					<div class="left">结算状态：</div>
					<div class="right">{{myCommisData.settleSts}}</div>
				</div>
				<div class="line" v-if="myCommisData.settleTime">
					<div class="left">结算时间：</div>
					<div class="right">{{myCommisData.settleTime | dateformat('YYYY-MM-DD HH:mm:ss')}}</div>
				</div>
				<div class="line">
					<div class="left">下级用户：</div>
					<div class="right">{{myCommisData.subUserName}}</div>
				</div>
			</div>
		</div>
		<Noempty class="Noempty" :pic="require('../../../assets/images/record-empty.png')" :title="'没有符合条件的数据'"  v-if="!myCommisData"/>
		<!-- /账单详情 -->
	</div>
</template>

<script>
import Noempty from 'components/Noempty/Noempty';
import cash from 'utils/tool';//引入处理分割金额的方法(变量)
import {pdCashLogDetail} from 'api/preDeposit';
export default {
	components:{
		Noempty
	},
	data () {
		return {
			Money: cash,
			myCommisData:this.$route.query.myCommisData,
			pdCashLogDetailData:'',
			commisTypeText:''//存放账单类型
		}
	},
	mounted () {
    let that = this

		if (this.$route.query.myCommisData) {
			switch(this.myCommisData.commisType){
				case 'FIRST_COMMIS':this.commisTypeText='直接下级奖励';break;
				case 'SECOND_COMMIS':this.commisTypeText='下二级奖励';break;
				case 'THIRD_COMMIS':this.commisTypeText='下三级奖励';break;
				case 'REG_COMMIS':this.commisTypeText='推广注册奖励';break;
				default:this.commisTypeText='获取数据失败'}
		} else {
			this.$toast({duration: 1000,message:'获取数据失败'})
		}
	}
}
</script>

<style src="../../../assets/css/pre-deposit.css" scoped></style>
